/*
 * Copyright 2012 Focus Technology, Co., Ltd. All rights reserved.
 */
package com.fujitsu.nanjing.tieba.controller.home;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.fujitsu.nanjing.tieba.base.BaseController;
import com.fujitsu.nanjing.tieba.domain.SectionInfo;
import com.fujitsu.nanjing.tieba.service.SectionInfoService;

/**
 * HomeController.java
 * 
 * @author Qixiaobo-win8
 */
@Controller
@RequestMapping("/home")
public class HomeController extends BaseController {
	@Resource
	private SectionInfoService sectionInfoService;
	@RequestMapping(value = {"/", "/index"}, method = RequestMethod.GET)
	public String show(Model model) {
		List<SectionInfo> sectionInfos = sectionInfoService.findAll();
		model.addAttribute("sectionInfos", sectionInfos);
		return "/home/index";
	}
}
